package com.vrv.app.cyberspace.modules.sys.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import org.hibernate.validator.constraints.NotBlank;

import java.io.Serializable;

/**
 * <p>
 * <p>
 * </p>
 *
 * @author sm
 * @since 2017-12-15
 */
@TableName("USER_TABLE")
public class UserTable extends Model<UserTable> implements Cloneable {

    private static final long serialVersionUID = 1L;

    @TableId("linkdoodID")
    @NotBlank
    private String linkdoodID;
    private String linkdoodName;
    private String photoUrl;
    private String cellphone;
    private String orgName;
    private String orgID;
    private Integer isOnDuty;
    private Integer isSuper;
    private Integer roleID;

    @TableField(exist = false)
    private RoleTable role;


    public String getLinkdoodID() {
        return linkdoodID;
    }

    public void setLinkdoodID(String linkdoodID) {
        this.linkdoodID = linkdoodID;
    }

    public String getLinkdoodName() {
        return linkdoodName;
    }

    public void setLinkdoodName(String linkdoodName) {
        this.linkdoodName = linkdoodName;
    }

    public String getPhotoUrl() {
        return photoUrl;
    }

    public void setPhotoUrl(String photoUrl) {
        this.photoUrl = photoUrl;
    }

    public String getCellphone() {
        return cellphone;
    }

    public void setCellphone(String cellphone) {
        this.cellphone = cellphone;
    }

    public String getOrgName() {
        return orgName;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    public String getOrgID() {
        return orgID;
    }

    public void setOrgID(String orgID) {
        this.orgID = orgID;
    }

    public Integer getIsOnDuty() {
        return isOnDuty;
    }

    public void setIsOnDuty(Integer isOnDuty) {
        this.isOnDuty = isOnDuty;
    }

    public Integer getIsSuper() {
        return isSuper;
    }

    public void setIsSuper(Integer isSuper) {
        this.isSuper = isSuper;
    }

    public Integer getRoleID() {
        return roleID;
    }

    public void setRoleID(Integer roleID) {
        this.roleID = roleID;
    }

    @Override
    protected Serializable pkVal() {
        return this.linkdoodID;
    }

    @Override
    public String toString() {
        return "UserTable{" +
                ", linkdoodID=" + linkdoodID +
                ", linkdoodName=" + linkdoodName +
                ", photoUrl=" + photoUrl +
                ", cellphone=" + cellphone +
                ", orgName=" + orgName +
                ", orgID=" + orgID +
                "}";
    }

    public RoleTable getRole() {
        return role;
    }

    public void setRole(RoleTable role) {
        this.role = role;
    }

    /**
     * equals 和hashCode 集合(List/Set)去重服务
     * 豆豆号和组织ID没有变动就相等于相等
     */
    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof UserTable)) {
            return false;
        }
        UserTable userTable = (UserTable) obj;
        return this.toString().equals(userTable.toString());
    }

    @Override
    public int hashCode() {
        return this.toString().hashCode();
    }

    @Override
    public UserTable clone() throws CloneNotSupportedException {
        return (UserTable) super.clone();
    }
}
